/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.gac.gacmod.model.steps;

import org.gac.gacmod.model.*;
import javax.swing.JOptionPane;
import org.gac.gacmod.genetics.ExecutionInput;
import org.gac.gacmod.genetics.ExecutionOutput;
import org.gac.gacmod.messages.MessageCollection;

/**
 *
 * @author Tomek
 */
public class ShowMessageStep extends AtomicStep
{


    private String _message;
    
    public ShowMessageStep(String name)
    {
        super(name);
    }

    public ShowMessageStep()
    {
        this( null );
    }



    @Override
    public ExecutionOutput Run(ExecutionInput input)
    {
         JOptionPane.showMessageDialog( null, "Example executed\n" + _message );
         return new ExecutionOutput(null, false, input.getPopulation());
    }

    @Override
    public void Validate(MessageCollection messages)
    {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    /**
     * @return the _message
     */
    @Configuration
    public String getMessage()
    {
        return _message;
    }

    /**
     * @param message the _message to set
     */
    @Configuration
    public void setMessage(String message)
    {
        this._message = message;
    }
}
